package com.xinhe.web.controller;

import com.querydsl.core.QueryResults;
import com.xinhe.web.common.Result;
import com.xinhe.web.entity.SellerShopTypeGoodsRelation;
import com.xinhe.web.service.SellerShopTypeGoodsRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "商家店铺分类商品关系表", tags = {"商家店铺分类商品关系表"})
@RestController
@RequestMapping(value = {"/sellerShopTypeGoodsRelation"}, produces = {"application/json;charset=UTF-8"})

public class SellerShopTypeGoodsRelationController {
    @Autowired
    private SellerShopTypeGoodsRelationService sellerShopTypeGoodsRelationService;

    @ApiOperation(httpMethod = "GET", value = "分页查询商家店铺分类商品关系表")
    @RequestMapping({"/pageSellerShopTypeGoodsRelation"})
    public QueryResults<SellerShopTypeGoodsRelation> pageSellerShopTypeGoodsRelation(int pageNum, int pageSize) {
        return this.sellerShopTypeGoodsRelationService.pageSellerShopTypeGoodsRelation(pageNum,pageSize);
    }

    @ApiOperation(httpMethod = "POST", value = "保存商家店铺分类商品关系表")
    @RequestMapping({"/saveSellerShopTypeGoodsRelation"})
    public Result saveSellerShopTypeGoodsRelation(Long id,Long sellerShopTypeId,Long goodsId,String remark) {
        return this.sellerShopTypeGoodsRelationService.saveSellerShopTypeGoodsRelation(id,sellerShopTypeId,goodsId,remark);
    }
    @ApiOperation(httpMethod = "GET", value = "删除商家店铺分类商品关系表")
    @ApiImplicitParam(name = "sellerShopTypeGoodsRelationId", value = "标识", required = true)
    @RequestMapping({"/deleteSellerShopTypeGoodsRelation"})
    public Result deleteSellerShopTypeGoodsRelation(Long sellerShopTypeGoodsRelationId) {
        return this.sellerShopTypeGoodsRelationService.delete(sellerShopTypeGoodsRelationId);
    }

    @ApiOperation(httpMethod = "GET", value = "商家店铺分类商品关系表详情")
    @ApiImplicitParam(name = "sellerShopTypeGoodsRelationId", value = "标识", required = true)
    @RequestMapping({"/detailSellerShopTypeGoodsRelation"})
    public Result detailSellerShopTypeGoodsRelation(Long sellerShopTypeGoodsRelationId) {
        return this.sellerShopTypeGoodsRelationService.findById(sellerShopTypeGoodsRelationId);
    }
}
